<% layout('layout.ejs') -%>
<div ng-controller="UserManageCtr">
<button class="btn btn-primary" onclick="window.location='/add_or_edit_user'">新增</button>
<button class="btn btn-primary" ng-click="inuse()">启用</button>
<button class="btn btn-primary" ng-click="unuse()">禁用</button>
<button class="btn btn-primary" ng-click="deleteAll()">删除</button>
<div style="width: 100%;height: 20px;"></div>
<div class="box">
    <div class="box-header">
        <h3 class="box-title">用户列表</h3>
        <div class="box-tools">
            <div class="input-group" style="width: 150px;">
                <input class="form-control input-sm pull-right" type="text" placeholder="Search" name="table_search">
                <div class="input-group-btn">
                    <button class="btn btn-sm btn-default">
                        <i class="fa fa-search"></i>
                    </button>
                </div>
            </div>
        </div>
    </div>
    <!--列表-->
    <div class="box-body table-responsive no-padding">
        <table class="table table-hover">
            <tbody>
            <tr>
                <th><input type="checkbox"></th>
                <th>登录名</th>
                <th>昵称</th>
                <th>最后登录时间</th>
                <th>状态</th>
                <th>ip</th>
                <th>操作</th>
            </tr>
            <tr ng-repeat="user in UserList track by $index">
                <td><input type="checkbox" ng-click="check($event,$index)" ng-checked="isChecked($index)"></td>
                <td>{{user.id}}</td>
                <td>{{user.username}}</td>
                <td>{{user.last_login_time | date: 'yyyy-MM-dd hh:mm:ss'}}</td>
                <td>
                    <span class="label label-success">{{user.status | filterStatus }}</span>
                </td>
                <td>{{user.last_login_ip}}</td>
                <td>
                    <button class="btn" ng-click="edit($index)">编辑</button>
                    <button class="btn" ng-click="delete($index)">删除</button>
                </td>
            </tr>

            </tbody>
        </table>
    </div>
    <!--分页-->
    <div class="box-footer clearfix">
        <ul class="pagination pagination-sm no-margin pull-right">
            <li>
                <a href="#">«</a>
            </li>
            <li>
                <a href="#">1</a>
            </li>
            <li>
                <a href="#">2</a>
            </li>
            <li>
                <a href="#">3</a>
            </li>
            <li>
                <a href="#">»</a>
            </li>
        </ul>
    </div>
</div>
</div>

<% block('footer').append('<script src="/script/basedata.js"></script>') %>
<% block('footer').append('<script src="/script/filters.js"></script>') %>